
package com.yimixian.app.model;

import com.ta.utdid2.android.utils.StringUtils;
import com.yimixian.app.address.MutableAddress;

import java.io.Serializable;

public class Address implements Serializable{

    public int id;
    public boolean isPickup;
    public String name;
    public String gender;
    public String tel;
    public String provinceKey;
    public String province;
    public String cityKey;
    public String city;
    public String districtKey;
    public String district;
    public String address;
    public String poiId;
    public String poiName;
    public String poiAddress;
    public String roomNo;
    public String tag;
    public String longitude="";
    public String latitude="";
    public String coordSystem;
    public String storeId = "";

    public Address(){}
    //经纬度区分
    public void setLocateAddress(Address ad){
        this.id = ad.id;
        this.name = ad.name;
        this.gender = ad.gender;
        this.tel = ad.tel;
        this.address = ad.address;
        this.provinceKey = ad.provinceKey;
        this.province = ad.province;
        this.cityKey = ad.cityKey;
        this.city = ad.city;
        this.districtKey = ad.districtKey;
        this.district = ad.district;
        this.poiId = ad.poiId;
        this.poiName = ad.poiName;
        this.poiAddress = ad.poiAddress;
        this.roomNo = ad.roomNo;
        this.tag = ad.tag;
        this.coordSystem = ad.coordSystem;
        this.isPickup = ad.isPickup;
        this.storeId = ad.storeId;
    }
    public Address(
            int id,
            String name,
            String gender,
            String tel,
            String address,
            String city,
            String poiId,
            String poiName,
            String poiAddress,
            String roomNo,
            String tag,
            String longitude,
            String latitude,
            String coordSystem, boolean isPickup) {
        this.id = id;
        this.name = name;
        this.gender = gender;
        this.tel = tel;
        this.address = address;
        this.city = city;
        if (!StringUtils.isEmpty(poiId) && !poiId.contains("bd-")){
            this.poiId = "bd-" + poiId;
        }
        this.poiName = poiName;
        this.poiAddress = poiAddress;
        this.roomNo = roomNo;
        this.tag = tag;
        this.longitude = longitude;
        this.latitude = latitude;
        this.coordSystem = coordSystem;
        this.isPickup = isPickup;
    }


    public Address(MutableAddress mutableAddress) {
        this.id = mutableAddress.id;
        this.name = mutableAddress.name;
        this.gender = mutableAddress.gender;
        this.tel = mutableAddress.tel;
        this.address = mutableAddress.address;
        this.cityKey = mutableAddress.cityKey;
        this.city = mutableAddress.city;
        this.provinceKey = mutableAddress.provinceKey;
        this.province = mutableAddress.province;
        this.districtKey = mutableAddress.districtKey;
        this.district = mutableAddress.district;
        this.poiId = mutableAddress.poiId;
        this.poiName = mutableAddress.poiName;
        this.poiAddress = mutableAddress.poiAddress;
        this.roomNo = mutableAddress.roomNo;
        this.tag = mutableAddress.tag;
        this.longitude = mutableAddress.longitude;
        this.latitude = mutableAddress.latitude;
        this.coordSystem = mutableAddress.coordSystem;
        this.storeId = mutableAddress.storeId;
        this.isPickup = mutableAddress.isPickup;
    }
}
